package com.lft.freshordering.controller;


import com.lft.freshordering.entity.GoodsUnit;
import com.lft.freshordering.response.R;
import com.lft.freshordering.response.StatusEnum;
import com.lft.freshordering.service.IGoodsUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tyhxzy
 * @since 2024-12-02
 */
@RestController
@RequestMapping("/lft/goods-unit")
public class GoodsUnitController {

    @Autowired
    private IGoodsUnitService goodsUnitService;
    @RequestMapping("/unit")
    public R<GoodsUnit> unit(){
        GoodsUnit goodsUnit = goodsUnitService.selectgoodsUnit();
        if(goodsUnit!=null){
            return R.success(goodsUnit);
        }else {
            return R.error(StatusEnum.SERVICE_ERROR);
        }
    }

}
